﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/EditMaster.Master" AutoEventWireup="true"
    CodeBehind="EditUpLoadFiles.aspx.cs" Inherits="BugSysSolution.DataManagement.EditUpLoadFiles" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="height: 440px; overflow-y: auto">
        <table class="tab" style="height: 30px">
            <tr>
                <td>
                    Id
                </td>
                <td>
                    Name
                </td>
                <td>
                    User
                </td>
                <td>
                    DateTime
                </td>
                <td>
                    Delete
                </td>
            </tr>
            <asp:Repeater ID="rep1" runat="server">
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("Id")%>
                        </td>
                        <td>
                            <a>
                                <%# Eval("FileName")%></a>
                        </td>
                        <td>
                            <a href="#" target="_blank" tag='<%# Eval("userid") %>' onclick="userinfo(this);">
                                <%# Eval("CreateUser")%></a>
                        </td>
                        <td>
                            <%# Eval("CreateDate")%>
                        </td>
                        <td>
                            <a href="#" fileid='<%# Eval("id")%>' fileurl='<%# Eval("FileUrl")%>' onclick="DelFile(this);">
                                Delete</a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
        <webdiyer:AspNetPager ID="Pager" runat="server" PageIndexBoxType="TextBox" ShowPageIndexBox="Never"
            SubmitButtonText="" TextAfterPageIndexBox="" TextBeforePageIndexBox="" CurrentPageButtonPosition="End"
            ShowCustomInfoSection="Right" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
            FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" OnPageChanged="Pager_PageChanged"
            PrevPageText="上一页" Direction="LeftToRight" ShowMoreButtons="False" ShowPageIndex="False"
            HorizontalAlign="Right" PageSize="4">
        </webdiyer:AspNetPager>
    </div>
    <script type="text/javascript">
        var requestUrl = "../RequestAjaxPage/FileAjaxPage.aspx";

        function DelFile(obj) {
            var parm = {
                tag: "delfile",
                ran: Math.random(),
                fileid: $(obj).attr("fileid"),
                filename: $(obj).attr("fileurl")
            };
            if (confirminfo("是否删除文件?")) {
                SendAjax("post", requestUrl, parm, "text", function (data) {
                    if (data == "Success") {
                        $(obj).parent().parent().remove();
                    } else {
                        alert(data);
                    }
                })
            }
        }

        function userinfo(obj) {
            window.location.href = "../UserInfo/MyInfo.aspx?id=" + $(obj).attr("tag");
        }
    </script>
</asp:Content>
